package com.weiqiao.mall.rest;


import com.weiqiao.aop.log.Log;
import com.weiqiao.mall.service.IReceiptService;
import com.weiqiao.mall.service.vo.ReceiptVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 提现管理控制层 CashManagementController
 *
 * @author
 */
@RestController
@RequestMapping("/api")
public class CashManagementController {

    /**
     * 余额提现业务层
     */
    @Autowired
    private IReceiptService receiptService;

    @Log("余额提现列表")
    @GetMapping("/receipt")
    public ResponseEntity receipt(ReceiptVO receiptVO) {
        return new ResponseEntity(receiptService.findReceiptList(receiptVO), HttpStatus.OK);
    }

    @Log("审核通过")
    @PostMapping("/update-deal")
    public ResponseEntity updateDealStatusById(@RequestBody ReceiptVO receiptVO) {
        return new ResponseEntity(receiptService.updateDealStatusById(receiptVO), HttpStatus.OK);
    }

    @Log("审核驳回")
    @PostMapping("/rebut-receipt")
    public ResponseEntity rebutReceipt(@RequestBody ReceiptVO receiptVO) {
        return new ResponseEntity(receiptService.rebutRecepit(receiptVO), HttpStatus.OK);
    }
}
